Skip to content

feat(serve): show the engine's metrics and log in a full-screen view - #177

Merged
outofcoffee merged 6 commits into
mainfrom
single-serve-ui
Sep 7, 2026
Merged

feat(serve): show the engine's metrics and log in a full-screen view#177
outofcoffee merged 6 commits into
mainfrom
single-serve-ui

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

spinloop serve on a terminal opens a full-screen view of the engine: its metrics above, its log below — piped runs are unchanged.

Summary

  • Running serve on a terminal opens a full-screen view: the engine's metrics (state and uptime, what is served, CPU, RAM and GPU as a gauge with its history beneath, and the token counters) above a tailed, followed log, with the view's keys in the footer
  • The log follows new output, scrolls with the arrows (a page at a time with pgup/pgdown), and f pauses and resumes the follow without losing a line; scrolled away from the tail the window stays put while new lines accrue behind it
  • Leaving the view (q or Ctrl+C) stops the engine through the supervisor, and serve exits with the engine's exit status — an engine that fails on its own takes serve down with it
  • Off a terminal nothing changes: the engine's output is forwarded to serve's own stdio and the printed command stays on stdout; on a terminal the view owns stdout, so the command goes to stderr. --dry-run never opens the view
  • With --api, the control API's log endpoint serves the captured engine log rather than reporting the log missing
  • docs/commands/serve.md documents the view, its keys, and the terminal/non-terminal split

Implementation details

  • runServe opens the view only when !dryRun && stdoutIsTerminal(); the engine's metrics endpoint is switched on for any supervised run so the view has its readings, and the printed command is the one that runs
  • The view and serve --api share one supervised-foreground construction (startSupervisedForeground): the engine under the daemon's supervisor, its output captured to daemon/engine.log, the control API beside it when asked. runServeForegroundAPI and runServeView are thin wrappers over it
  • The view reuses the fleet dashboard's rendering and cadence — the 2s metrics tick, the 3s log poll, the same stale rule, the same series formats — so a number worded in the view is one the dashboard would word the same way

@outofcoffee outofcoffee added the enhancement New feature or request label Sep 6, 2026
@outofcoffee outofcoffee self-assigned this Sep 7, 2026
@outofcoffee
outofcoffee enabled auto-merge (squash) September 7, 2026 08:14
@outofcoffee
outofcoffee disabled auto-merge September 7, 2026 08:14
@outofcoffee
outofcoffee merged commit fcd4f0e into main Sep 7, 2026
2 checks passed
@outofcoffee
outofcoffee deleted the single-serve-ui branch September 7, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant